package osgi.common.services.job;

import java.util.Set;

import org.apache.log4j.Logger;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import osgi.common.services.LoggerHelper;


@DisallowConcurrentExecution
public class HeartBeatJob implements Job {

	/**
	 * Logger for this class
	 */
	private static final Logger logger = LoggerHelper.getLogger(HeartBeatJob.class);

	public HeartBeatJob() {
		super();

		logger.info("Created");
	}

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		// logger.debug("execute(JobExecutionContext) - start");

		logger.info("execute(JobExecutionContext) Begin!");

		JobDataMap jdm = context.getMergedJobDataMap();
		Set<String> keys = jdm.keySet();
		for (String key : keys) {
			
			logger.info("Valor : (" + key + " = " + jdm.get(key) + ") ");
			
		}

		logger.info("execute(JobExecutionContext) End!");

		// logger.debug("execute(JobExecutionContext) - end");
	}

}
